(defun C:SORTMH ( / mhsortss mhcnt mhsortlist mhtext newmhss this-txt)
  (SETQ mhsortss (SSGET "x" '((8 . "newMH")(0 . "TEXT"))))
  (SETQ mhcnt 0)
  (WHILE (< mhcnt (SSLENGTH mhsortss))
    (SETQ mhtext (CDR (ASSOC 1 (ENTGET (SSNAME mhsortss mhcnt)))))
    (SETQ mhsortlist (APPEND mhsortlist (LIST (STRCAT "MH" mhtext))))
    (SETQ mhcnt (1+ mhcnt))
  )
  (SETQ newmhss (SSGET "x" '((8 . "MH")(0 . "TEXT"))))
  (SETQ mhcnt 0)
  (WHILE (< mhcnt (SSLENGTH newmhss))
    (IF (MEMBER (CDR (ASSOC 1 (ENTGET (SSNAME newmhss mhcnt)))) mhsortlist)
      (PROGN
	(SETQ this-txt (ENTGET (SSNAME newmhss mhcnt)))
	(SETQ this-txt (SUBST (CONS 8 "newMH") (ASSOC 8 this-txt) this-txt))
	(SETQ this-txt (SUBST (CONS 62 7) (ASSOC 62 this-txt) this-txt))
	(ENTMOD this-txt)
      )
    )
    (SETQ mhcnt (1+ mhcnt))
  )
)